/**
 * 
 */
package org.statewalker.parser.xhtml.validator;

import org.statewalker.parser.xhtml.grammar.TopicDict;
import org.statewalker.parser.xhtml.grammar.XHTMLDict;

public class TopicValidator extends XHTMLValidator {

    public TopicValidator(TopicValidatorFactory factory) {
        super(factory);
    }

    @Override
    protected boolean canClose(String stateKey, String tokenKey) {
        if (tokenKey == XHTMLDict.DIV) {
            if (TopicDict.DEFAULT_CONTENT.equals(stateKey)
                || TopicDict.CONTENT1.equals(stateKey)
                || TopicDict.CONTENT2.equals(stateKey)
                || TopicDict.CONTENT3.equals(stateKey)
                || TopicDict.CONTENT4.equals(stateKey)
                || TopicDict.CONTENT5.equals(stateKey)
                || TopicDict.CONTENT6.equals(stateKey)) {
                return false;
            }
        }
        return super.canClose(stateKey, tokenKey);
    }
}